namespace Digitalmes.Application.Mes;

/// <summary>
/// 物料产品信息表
/// </summary>
public sealed class MdItemDto : Dto
{
    /// <summary>
    /// 物料编号
    /// </summary>
    [Required]
    [StringLength(64)]
    public string? ItemCode { get; set; }

    /// <summary>
    /// 物料名称
    /// </summary>
    [Required]
    [StringLength(64)]
    public string? ItemName { get; set; }

    /// <summary>
    /// 物料型号
    /// </summary>
    public string? Model { get; set; }

    /// <summary>
    /// 物料规格
    /// </summary>
    public string? Spec { get; set; }

    /// <summary>
    /// 计量单位
    /// </summary>
    public string? Unit { get; set; }

    /// <summary>
    /// 物料属性（自制件/外购件/外协件）
    /// </summary>
    public MaterialAttrEnum Attr { get; set; }

    public string? AttrDesc => Attr.Description();

    /// <summary>
    /// 物料分类（成品/半产品/原材料）
    /// </summary>
    public MaterialClassifyEnum Classify { get; set; }

    public string? ClassifyDesc => Classify.Description();

    /// <summary>
    /// 条码校验规则，多个以逗号分隔
    /// </summary>
    [NotNull]
    public List<string>? Rules { get; set; }

    /// <summary>
    /// 保质期（天）
    /// </summary>
    public int Expiration { get; set; }

    /// <summary>
    /// 物料供应商
    /// </summary>
    public string? Supplier { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    public string? CreateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    public string? UpdateUser { get; set; }
}
